// 对应分类的JsonModel
// 大分类列表
class BigCategoryListModel { 
  List<BigCategory> bigCategoryList = [];

  BigCategoryListModel({this.bigCategoryList});

  factory BigCategoryListModel.fromJson(List json){
    return BigCategoryListModel(bigCategoryList: json.map((item)=>BigCategory.fromJson(item)).toList());
}

}


// 大分类
class BigCategory {
  // 大分类id
   String bigCategoryId;
   // 大分类名字
   String bigCategoryName;
   // 小类列表
   List<SmallCategory> smallCategoryList;
   // 大分类图片
   String image;

  BigCategory({this.bigCategoryId, this.bigCategoryName, this.smallCategoryList, this.image});
  
  factory BigCategory.fromJson(dynamic json){
    
    List smallCategorys = json['smallCategorys'];
    
    List smallCategoryList =  smallCategorys.map((item)=>SmallCategory.fromJson(item)).toList(); 

    return BigCategory(
      bigCategoryId:json['bigCategoryId'],
      bigCategoryName:json['bigCategoryName'],
      smallCategoryList:smallCategoryList,
      image:json['image'],
    );
  }
}
// 小分类
class SmallCategory {
  // 小分类id
   String smallCategoryId;
  // 小分类名称
   String smallCategoryName;

  SmallCategory({this.smallCategoryId, this.smallCategoryName});

  factory SmallCategory.fromJson(dynamic json){
    return SmallCategory(
      smallCategoryName:json['smallCategoryName'],
      smallCategoryId:json['smallCategoryId']
    );
  }

}